Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Refactor templates from legacy Cursor rules to agents.md format#51

Merged
jhaynie merged 2 commits intomainfrom
devin/1755667839-refactor-cursor-rules-to-agents-md
Aug 21, 2025
Merged

Refactor templates from legacy Cursor rules to agents.md format#51
jhaynie merged 2 commits intomainfrom
devin/1755667839-refactor-cursor-rules-to-agents-md

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Aug 20, 2025

Refactor templates from legacy Cursor rules to agents.md format

Summary

This PR migrates the Agentuity templates from the legacy .cursor/rules/*.mdc format to the new standardized AGENTS.md format following the specification from https://agents.md/.

Key changes:

  • Converted 5 legacy .mdc files into 3 consolidated AGENTS.md files:
    • common/AGENTS.md - General Agentuity configuration guidelines
    • common/js/AGENTS.md - JavaScript/TypeScript agent development guide
    • common/py/AGENTS.md - Python agent development guide
  • Updated all 3 rules.yaml files (python-uv, nodejs, bunjs) to copy AGENTS.md to project root instead of cursor files to .cursor/rules/
  • Removed legacy cursor directories entirely (common/cursor/, common/js/cursor/, common/py/cursor/)

The new AGENTS.md files combine SDK documentation with development guidelines in a single, standardized format that follows the emerging agents.md specification used by other AI development tools.

Review & Testing Checklist for Human

  • Test project creation end-to-end: Create new projects with agentuity new for all three runtimes (python-uv, nodejs, bunjs) and verify AGENTS.md files are created correctly in the project root
  • Verify content accuracy: Compare the new AGENTS.md files against the original .mdc files to ensure no important guidance or SDK documentation was lost during consolidation
  • Check schema compliance: Ensure the modified rules.yaml files still comply with rules.schema.json and use correct action syntax
  • Search for remaining .cursor references: Use grep -r "\.cursor" . to confirm no references to the old format remain anywhere in the repository
  • Test template functionality: Verify that the new create_file actions work correctly and place AGENTS.md in the right location with proper content

Review Focus Areas

The highest risk areas are the rules.yaml modifications since they control the entire project scaffolding process, and the content consolidation where multiple specialized files were merged into unified guides.


Diagram

%%{ init : { "theme" : "default" }}%%
flowchart TD
    subgraph Templates["Template System"]
        PythonRules["python-uv/rules.yaml"]:::major-edit
        NodeRules["nodejs/rules.yaml"]:::major-edit  
        BunRules["bunjs/rules.yaml"]:::major-edit
    end
    
    subgraph NewFiles["New AGENTS.md Files"]
        CommonAgents["common/AGENTS.md"]:::major-edit
        JSAgents["common/js/AGENTS.md"]:::major-edit
        PyAgents["common/py/AGENTS.md"]:::major-edit
    end
    
    subgraph Removed["Removed (Legacy)"]
        CursorDir["common/cursor/"]:::removed
        JSCursorDir["common/js/cursor/"]:::removed
        PyCursorDir["common/py/cursor/"]:::removed
    end
    
    PythonRules -->|"copies to project root"| PyAgents
    NodeRules -->|"copies to project root"| JSAgents
    BunRules -->|"copies to project root"| JSAgents
    
    CursorDir -.->|"replaced by"| CommonAgents
    JSCursorDir -.->|"consolidated into"| JSAgents
    PyCursorDir -.->|"consolidated into"| PyAgents
    
    subgraph Legend
        L1["Major Edit"]:::major-edit
        L2["Removed"]:::removed
    end
    
    classDef major-edit fill:#90EE90
    classDef removed fill:#FFB6C1
Loading

Notes

  • This refactoring follows the agents.md specification from https://agents.md/ which is becoming a standard for AI agent development guidance
  • The consolidation reduces complexity by eliminating the .cursor/rules/ directory structure in favor of a single root-level AGENTS.md file per project
  • Content was carefully preserved during the conversion, combining agent development guidelines with SDK documentation in a more accessible format

Link to Devin run: https://app.devin.ai/sessions/cd18f4d5e52b4f319d61ed0710d94e3b
Requested by: @jhaynie

Summary by CodeRabbit

  • Documentation

    • Rewrote and consolidated JavaScript/TypeScript and Python agent docs into structured developer guides with numbered sections, examples, best practices, storage and logging guidance, and environment/workflow notes.
    • Added a general AGENTS overview covering environment and secret-management guidance; removed older, redundant guideline docs.
  • Chores

    • Updated project scaffolding to include the new AGENTS guide and stop generating legacy editor-rule guideline files.

- Convert 5 .mdc files to 3 consolidated AGENTS.md files
- Update python-uv, nodejs, and bunjs rules.yaml to use new format
- Remove legacy .cursor/rules directories and files
- Follow agents.md specification from https://agents.md/

Files changed:
- Created common/AGENTS.md (general Agentuity configuration guidelines)
- Created common/js/AGENTS.md (JavaScript/TypeScript agent development)
- Created common/py/AGENTS.md (Python agent development)
- Updated rules.yaml files to copy AGENTS.md to project root
- Removed common/cursor/, common/js/cursor/, common/py/cursor/ directories

Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 20, 2025

Walkthrough

Replaces .cursor/rules *.mdc copies with project-root AGENTS.md creation across bunjs, nodejs, and python-uv templates. Adds new AGENTS.md docs (root, JS/TS, Python). Removes legacy cursor .mdc guidance files. No runtime logic changes; only template step adjustments and documentation restructuring.

Changes

Cohort / File(s) Summary
Template rule updates
bunjs/rules.yaml, nodejs/rules.yaml, python-uv/rules.yaml
In new_project steps, removed copy_dir of *.mdc into .cursor/rules; added create_file to place AGENTS.md at project root from language-specific sources; other steps unchanged.
JS/TS docs refresh
common/js/AGENTS.md
Rewrote from SDK reference to structured Agent Development Guide; added example agent, numbered sections, prescriptive guidelines; no API changes.
Python docs refresh
common/py/AGENTS.md
Reworked into Agent Development Guide; added example, numbered structure; wording/organization updates only.
Root guidance addition
common/AGENTS.md
New general Agentuity configuration and workflow guidance; environment/secrets practices; documentation only.
Legacy cursor docs removed
common/cursor/agentuity.mdc, common/js/cursor/agent.mdc, common/py/cursor/agent.mdc
Deleted obsolete .mdc guidance files previously copied into .cursor/rules.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant Tool as Template Generator
  participant Repo as New Project

  Dev->>Tool: Run new_project
  Tool->>Repo: create_file README.md (unchanged)
  Tool->>Repo: create_file AGENTS.md (from language-specific common/*/AGENTS.md)
  Tool->>Repo: create_file .editorconfig (unchanged)
  Note over Tool,Repo: Removed prior copy_dir of *.mdc to .cursor/rules
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • rblalock
  • jhaynie

Poem

A rabbit taps a tiny key,
Out hop agents, docs set free.
No more cursor scrolls to read—
AGENTS.md now plants the seed.
Hop, commit, and swiftly cheer,
Fresh guides bloom in the root this year. 🥕✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 305c28f and 3df6d33.

📒 Files selected for processing (1)
  • python-uv/rules.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • python-uv/rules.yaml
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1755667839-refactor-cursor-rules-to-agents-md

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot requested a review from rblalock August 20, 2025 05:36
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (7)
common/py/AGENTS.md (1)

95-99: Confirm Python logger method naming: warn vs warning

Many Python loggers follow the stdlib naming (warning vs warn, where warn is deprecated). If Agentuity’s logger follows stdlib semantics, consider using warning. If not, please ignore. Proposed tweak shown below.

- - `context.logger.warn(message, *args, **kwargs)`: Logs a warning message
+ - `context.logger.warning(message, *args, **kwargs)`: Logs a warning message
python-uv/rules.yaml (1)

93-95: Consider creating a stub .env.production during scaffold

Docs recommend .env.production, but the scaffold only creates .env.development. Creating an empty .env.production improves DX and consistency.

     - action: create_file
       filename: ".env.development"
       from: "common/env.development"
+    - action: create_file
+      filename: ".env.production"
+      content: ""
common/js/AGENTS.md (3)

8-8: Tighten wording for type imports

Minor clarity improvement; “in the node_modules folder” is redundant.

-- Prefer loading types from the node modules package `@agentuity/sdk` in the node_modules folder
+- Prefer importing types from `@agentuity/sdk`

19-21: Fix markdownlint MD010 (hard tabs) in example

Replace the hard tab before the return statement with spaces to satisfy markdownlint.

-export default async function Agent(req: AgentRequest, resp: AgentResponse, ctx: AgentContext) {
-	return resp.json({hello: 'world'});
-}
+export default async function Agent(req: AgentRequest, resp: AgentResponse, ctx: AgentContext) {
+  return resp.json({ hello: "world" });
+}

50-51: Correct method signature formatting for typed object payload

Reads like a property; likely intended as a method.

-- `request.data.object<T>: Promise<T>`: Gets the payload as a typed object
+- `request.data.object<T>(): Promise<T>`: Gets the payload as a typed object
bunjs/rules.yaml (1)

120-121: Add .env.production scaffold for consistency with docs

The docs recommend .env.production; add a placeholder to help users.

     - action: create_file
       filename: ".env.development"
       from: "common/env.development"
+    - action: create_file
+      filename: ".env.production"
+      content: ""
nodejs/rules.yaml (1)

98-100: Optional: Link AGENTS.md from README for discoverability.

Consider adding a short “Developer Guide: see AGENTS.md” link in the README template so users spot it immediately after project creation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3b9f407 and 305c28f.

📒 Files selected for processing (9)
  • bunjs/rules.yaml (1 hunks)
  • common/AGENTS.md (1 hunks)
  • common/cursor/agentuity.mdc (0 hunks)
  • common/js/AGENTS.md (4 hunks)
  • common/js/cursor/agent.mdc (0 hunks)
  • common/py/AGENTS.md (4 hunks)
  • common/py/cursor/agent.mdc (0 hunks)
  • nodejs/rules.yaml (1 hunks)
  • python-uv/rules.yaml (1 hunks)
💤 Files with no reviewable changes (3)
  • common/py/cursor/agent.mdc
  • common/js/cursor/agent.mdc
  • common/cursor/agentuity.mdc
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
common/js/AGENTS.md

20-20: Hard tabs
Column: 1

(MD010, no-hard-tabs)

🔇 Additional comments (3)
common/AGENTS.md (1)

5-15: Clear, concise top-level guidance — LGTM

The migration to a single AGENTS.md at the root is well explained and aligns with the new templates. Nothing blocking here.

python-uv/rules.yaml (1)

74-76: AGENTS.md creation in root is correct and replaces legacy Cursor rules

The step places language-specific guidance where users expect it, and aligns with the removal of .cursor/rules/*.mdc.

bunjs/rules.yaml (1)

105-107: AGENTS.md is correctly generated from the JS guide

Good placement alongside README. This matches the PR objective to deprecate legacy .cursor copies.

Comment thread nodejs/rules.yaml
Comment on lines +98 to +100
- action: create_file
filename: "AGENTS.md"
from: "common/js/AGENTS.md"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

LGTM: AGENTS.md creation is correctly added at project root using the JS-specific source.

Placement after README.md and before editorconfig is good. The key names match existing create_file usage (“from”), and the path aligns with common/js assets used elsewhere in this template.

Run this script to verify end-to-end consistency across templates and ensure no legacy Cursor artifacts remain:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Verify AGENTS.md sources exist =="
for f in "common/js/AGENTS.md" "common/py/AGENTS.md" "common/AGENTS.md"; do
  if [[ -f "$f" ]]; then
    echo "OK: $f"
  else
    echo "MISSING: $f" >&2
  fi
done

echo
echo "== Check rules.yaml files include AGENTS.md creation =="
# Show the AGENTS.md create_file blocks in the three templates
for dir in nodejs bunjs python-uv; do
  if [[ -f "$dir/rules.yaml" ]]; then
    echo "-- $dir/rules.yaml --"
    rg -nP -C3 'action:\s*create_file\s*\n\s*filename:\s*"AGENTS\.md"\s*\n\s*(from|template):\s*"(common/(js|py)/AGENTS\.md)"' "$dir/rules.yaml" || echo "AGENTS.md create_file block NOT FOUND in $dir/rules.yaml" >&2
    echo
  fi
done

echo "== Ensure no legacy .cursor/.mdc references remain =="
# Expect: no matches
if rg -nP -C1 '(\.cursor/|\.mdc\b)' ; then
  echo "Found legacy .cursor/.mdc references above. Please remove or update." >&2
else
  echo "OK: No legacy .cursor/.mdc references found."
fi

echo
echo "== Ensure no copy_dir to .cursor/rules remains =="
# Expect: no matches
if rg -nP -C2 'action:\s*copy_dir|\.cursor/rules' -- '*.yaml' ; then
  echo "Found copy_dir/.cursor/rules usage above. Please remove or update." >&2
else
  echo "OK: No copy_dir to .cursor/rules found in YAML."
fi

Length of output: 2501


Missing AGENTS.md in bunjs & python-uv templates

All AGENTS.md sources (common/js/AGENTS.md, common/py/AGENTS.md, common/AGENTS.md) exist and no legacy .cursor/.mdc artifacts remain, but the create_file block is only in nodejs/rules.yaml. The other two language templates need the same addition:

• bunjs/rules.yaml
• python-uv/rules.yaml

Please add, immediately after the README.md step (and before the editorconfig step), in each file:

    - action: create_file
      filename: "AGENTS.md"
      from: "common/js/AGENTS.md"   # use common/py/AGENTS.md in python-uv

For example, in bunjs/rules.yaml:

@@
-   - action: create_file
-     filename: "README.md"
+   - action: create_file
+     filename: "AGENTS.md"
+     from: "common/js/AGENTS.md"
    - action: create_file
      filename: "README.md"

And in python-uv/rules.yaml swap in from: "common/py/AGENTS.md".

🤖 Prompt for AI Agents
In nodejs/rules.yaml lines 98-100 the create_file for AGENTS.md exists;
replicate this in bunjs/rules.yaml and python-uv/rules.yaml by inserting,
immediately after the README.md create_file step and before the editorconfig
step, a create_file block that creates "AGENTS.md" from the common template; for
bunjs use from: "common/js/AGENTS.md" and for python-uv use from:
"common/py/AGENTS.md" so each template adds the AGENTS.md file in the same
position as nodejs.

Copy link
Copy Markdown
Member

@jhaynie jhaynie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In nodejs/rules.yaml lines 98-100 the create_file for AGENTS.md exists;
replicate this in bunjs/rules.yaml and python-uv/rules.yaml by inserting,
immediately after the README.md create_file step and before the editorconfig
step, a create_file block that creates "AGENTS.md" from the common template; for
bunjs use from: "common/js/AGENTS.md" and for python-uv use from:
"common/py/AGENTS.md" so each template adds the AGENTS.md file in the same
position as nodejs.

Move AGENTS.md creation to after README.md and before .editorconfig
to match the positioning in nodejs and bunjs templates.

Addresses feedback from @jhaynie in PR #51.

Co-Authored-By: jhaynie@agentuity.com <jhaynie@gmail.com>
@coderabbitai coderabbitai Bot requested a review from jhaynie August 20, 2025 18:08
@jhaynie jhaynie merged commit 02b1307 into main Aug 21, 2025
4 checks passed
@jhaynie jhaynie deleted the devin/1755667839-refactor-cursor-rules-to-agents-md branch August 21, 2025 01:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant